home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 283_02 / crc.doc < prev    next >
Text File  |  1984-12-30  |  5KB  |  118 lines

  1.                 CRC for MSDOS & Concurrent PC-DOS
  2.                by Howard Vigorita,  NYACC CP/M SIG
  3.     upload comments, etc. to: (718) 539-3338  (BBS)
  4.  
  5.      This is a MSDOS generic program derived from the CP/M-86 
  6. version by Bill Bolton found on SIG/M Volume #210. MSDOS 2.0 or
  7. higher is required for operation. This is a disk file CRC 
  8. checking and generating utility originally written for CP/M-80,
  9. CP/M-86, MP/M-86 and Concurrent PC-DOS, now available for MSDOS.
  10. CRC will run on systems with as little as 25K of RAM.
  11.  
  12.     CRC is a companion utility to CRCBUILD which creates -CATALOG 
  13. files. This utility uses the -CATALOG file as an interactive look 
  14. up table and displays *MATCH* on your screen next to each line 
  15. whose embedded CRC agrees with disk contents. This CRC utility 
  16. may be used to verify the integrity of PC-BLUE or SIG/M public 
  17. domain distribution disks, all of which contain a standard format 
  18. -CATALOG file.
  19.  
  20.      This utility will optionally create an output file on 
  21. the default drive, listing the CRC's of all files checked in a
  22. single session. That output file may be used in place of the 
  23. -CATALOG file to perform integrity checks.
  24.  
  25.  
  26. COMMANDS:
  27.  
  28.         CRC [drive:]<filename.filetype> [F]
  29.  
  30.         Examples:
  31.  
  32.     CRC            Will attempt to find CRCKLIST.???,
  33.                   or CRCKFILE.??? or -CATALOG.???    
  34.                   and try to match recorded CRC values
  35.                   in that file with values calculated
  36.                   on the fly for files on the disk. 
  37.  
  38.     CRC MYFILE.ASM        Check only MYFILE.ASM
  39.  
  40.     CRC B:*.ASM        Check all .ASM files ON B: drive
  41.  
  42.     CRC *.* F        Check all files, writing output to a file
  43.  
  44.  
  45.      Hidden files as well as files with the '$$$' extention are 
  46. ignored.
  47.  
  48.      Path names as part of the file specification are not 
  49. supported in this version. To check the CRC of files in a 
  50. sub-directory, first log in that sub-directory, then run CRC
  51. from a different drive with the drive designation of the sub-
  52. directory as part of the file specification. To run CRC from
  53. the root directory of the A: drive and CRC all files on the 
  54. \user\progs\asm sub-directory of the B: drive, do the following:
  55.  
  56.     A>cd B:\user\progs\asm
  57.     A>CRC B:*.*
  58.  
  59.  
  60. ALGORITHM NOTES
  61.  
  62.      The cyclic-redundancy-checksum (CRC) used in this program 
  63. is based on the following CCITT standard polynominal:
  64.  
  65.     X^16 + X^15 + X^13 + X^7 + X^4 + X^2 + X + 1
  66.  
  67.      A CRC is a 16 bit number which is derived by forming a hash 
  68. total of each byte contained in a file. A CRC differs from a 
  69. simple arithmetic checksum in that bit shifting is applied giving 
  70. the CRC byte order sensitivity. XMODEM, which implements both 
  71. simple checksum as well as CRC protocol has been determined to 
  72. detect 95% of transmission errors using checksums as oposed to 
  73. 99.95% with the same CCITT CRC employed here.
  74.  
  75.      Special attention in this implementation has been given 
  76. to insure that it generates CRC's which are not only compatable 
  77. with SIG/M -CATALOG files and XMODEM CRC's, but which are also 
  78. communication chanel insensitive. Generated CRC's will remain 
  79. unchanged when files are moved from MSDOS or UNIX through 
  80. communication's chanels which pad file resolution to 128 byte 
  81. block boundaries. It is thus useful for checking the accuracy of 
  82. such file transfers.
  83.  
  84.      This implementation achieves much greater accuracy than a 
  85. simple checksum with virtually no performance penalty. The CRC 
  86. algorithm employed herein uses the XOR mask and word shifting 
  87. techniques which prove table lookup methods slow by comparison. 
  88. See Greg Morse's article in BYTE, Septmeber 1986, page 115 for 
  89. the details of the mathematical theory. Sceptics may set the 
  90. CRC_ENABLE equate FALSE to assemble a version of this utility 
  91. which excludes the CRC generation subroutine and thus determine 
  92. by subtraction the amount of time consumed by that algorithm. The 
  93. CRC disabled version also makes for an interesting comparision 
  94. with the directory searching and disk reading efficiency of "COPY 
  95. *.* NUL". See, Dr. Dobbs Journal, "MS DOS Disk Speed" by D. E. 
  96. Cortesi, September 1985, page 12.
  97.  
  98. SPECIAL MSDOS NOTE
  99.  
  100.     This CRC version fixes a bug in some MSDOS versions whereby
  101. partial sectors of files were not being processed. Such versions
  102. generate "00 00" CRC values for files less than 128 bytes in length
  103. and incorrect values for files not an exact multiple of 128 bytes
  104. long. Use this version of CRC with CRCBUILD version 1.1 or greater
  105. which also fixes this bug.
  106.  
  107.  
  108. CREDITS
  109.  
  110.     The 8 bit version of the program was originally conceived 
  111. by Keith Petersen, W8SDZ, to whom all glory and honour. Due to 
  112. the scarcity of source code in the MSDOS public domain, the MSDOS 
  113. version of this program has been derived from the CP/M-86 version 
  114. by Bill Bolton, Software Tools BBS, Australia. Many thanks to 
  115. Bill Bolton and the many other CP/M-86 programmers who continue 
  116. enable the rest of us to learn from their examples in the best
  117. spirt of the public domain.
  118.